import { reqGoodsShow } from '@/api'

const state = {
  goodsShowInfo:[]
}
const mutations = {
  GETGOODSSHOW(state,goodsShowData){
    if(goodsShowData.pageNo == "1"){
      state.goodsShowInfo = goodsShowData
    }else{
      state.goodsShowInfo.goodsShow = [...state.goodsShowInfo.goodsShow,...goodsShowData.goodsShow]
    }
     
  }
}
const actions = {
  async getGoodsShow({commit}){
    const res = await reqGoodsShow()
    if(res.code == 200){
      commit('GETGOODSSHOW',res.data)
    }else{
      console.log('no')
    }
  }
}

export default{
  state,
  mutations,
  actions
}